<?php
namespace Home\Model;
use Think\Model;
class RegisterModel extends Model{
	protected $patchValidate=true;
	protected $_validate=array(
			array('username','require',"用户名不能为空"),
			array('nick','require',"昵称不能为空"),
			array('password','require',"密码不能为空"),
			array('repassword','require',"确认密码不能为空"),
			array('email','require',"邮箱不能为空"),
			array('username','','用户名已经被使用',1,'unique'),
			array('username','/^[a-z_]\w{3,19}$/i','用户名格式错误'),
			array('nick','/^\S{4,10}$/','昵称格式错误'),
			array('password',"/^\S{6,20}$/","密码格式错误"),
			array('repassword',"password","两次密码不一致",1,'confirm'),
			array('email','email',"邮箱格式错误"),
			array('mobile','/^1[35789]\d{9}$/','电话格式错误',2),
			array('age','18,99','年龄不能小于18',2,'between')
	);
	protected $_auto=array(
			array('password',"md5",3,'function'),
	);
	
	
	
	
	
	
}